#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc,char* argv[])
{
    if(argc != 2)
    {
        printf("usage: [mycat filename]\n");
        return 1;
    }

    FILE* pf = fopen(argv[1],"r");
    if(pf == NULL)
    {
        perror("fail\n");
        return 2;
    }

    while(1)
    {
        char buffer[128];
        memset(buffer,0,sizeof(buffer));

        fread(buffer,sizeof(buffer)-1,1,pf);
        printf("%s",buffer);
        if(feof(pf))
        {
            break;
        }

    }

    fclose(pf);

    return 0;
}
